#ifndef ASTAR_H
#define ASTAR_H

#include "grid.h"
#include <vector>
#include <map>
#include <utility>

class AStar {
public:
	AStar(Grid& grid);

	std::vector<std::pair<int, int>> findPath(const std::pair<int, int>& start, const std::pair<int, int>& goal);

private:
	double heuristic(const std::pair<int, int>& a, const std::pair<int, int>& b);
	std::vector<std::pair<int, int>> reconstructPath(std::pair<int, int> current, std::map<std::pair<int, int>, std::pair<int, int>>& came_from);

	Grid& grid_;
};

#endif
